//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS ComprehendMedical service.
///
/// Amazon Comprehend Medical extracts structured information from unstructured clinical text. Use these actions to gain insight in your documents. Amazon Comprehend Medical only detects entities in English language texts. Amazon Comprehend Medical places limits on the sizes of files allowed for different API operations. To learn more, see Guidelines and quotas in the Amazon Comprehend Medical Developer Guide.
public struct ComprehendMedical: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the ComprehendMedical client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "ComprehendMedical_20181030",
            serviceName: "ComprehendMedical",
            serviceIdentifier: "comprehendmedical",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2018-10-30",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: ComprehendMedicalErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "ca-central-1": "comprehendmedical-fips.ca-central-1.amazonaws.com",
            "us-east-1": "comprehendmedical-fips.us-east-1.amazonaws.com",
            "us-east-2": "comprehendmedical-fips.us-east-2.amazonaws.com",
            "us-gov-west-1": "comprehendmedical-fips.us-gov-west-1.amazonaws.com",
            "us-west-2": "comprehendmedical-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Gets the properties associated with a medical entities detection job. Use this operation to get the status of a detection job.
    @Sendable
    @inlinable
    public func describeEntitiesDetectionV2Job(_ input: DescribeEntitiesDetectionV2JobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeEntitiesDetectionV2JobResponse {
        try await self.client.execute(
            operation: "DescribeEntitiesDetectionV2Job", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the properties associated with a medical entities detection job. Use this operation to get the status of a detection job.
    ///
    /// Parameters:
    ///   - jobId: The identifier that Amazon Comprehend Medical generated for the job. The StartEntitiesDetectionV2Job operation returns this identifier in its response.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeEntitiesDetectionV2Job(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeEntitiesDetectionV2JobResponse {
        let input = DescribeEntitiesDetectionV2JobRequest(
            jobId: jobId
        )
        return try await self.describeEntitiesDetectionV2Job(input, logger: logger)
    }

    /// Gets the properties associated with an InferICD10CM job. Use this operation to get the status of an inference job.
    @Sendable
    @inlinable
    public func describeICD10CMInferenceJob(_ input: DescribeICD10CMInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeICD10CMInferenceJobResponse {
        try await self.client.execute(
            operation: "DescribeICD10CMInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the properties associated with an InferICD10CM job. Use this operation to get the status of an inference job.
    ///
    /// Parameters:
    ///   - jobId: The identifier that Amazon Comprehend Medical generated for the job. The StartICD10CMInferenceJob operation returns this identifier in its response.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeICD10CMInferenceJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeICD10CMInferenceJobResponse {
        let input = DescribeICD10CMInferenceJobRequest(
            jobId: jobId
        )
        return try await self.describeICD10CMInferenceJob(input, logger: logger)
    }

    /// Gets the properties associated with a protected health information (PHI) detection job. Use this operation to get the status of a detection job.
    @Sendable
    @inlinable
    public func describePHIDetectionJob(_ input: DescribePHIDetectionJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribePHIDetectionJobResponse {
        try await self.client.execute(
            operation: "DescribePHIDetectionJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the properties associated with a protected health information (PHI) detection job. Use this operation to get the status of a detection job.
    ///
    /// Parameters:
    ///   - jobId: The identifier that Amazon Comprehend Medical generated for the job. The StartPHIDetectionJob operation returns this identifier in its response.
    ///   - logger: Logger use during operation
    @inlinable
    public func describePHIDetectionJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribePHIDetectionJobResponse {
        let input = DescribePHIDetectionJobRequest(
            jobId: jobId
        )
        return try await self.describePHIDetectionJob(input, logger: logger)
    }

    /// Gets the properties associated with an InferRxNorm job. Use this operation to get the status of an inference job.
    @Sendable
    @inlinable
    public func describeRxNormInferenceJob(_ input: DescribeRxNormInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeRxNormInferenceJobResponse {
        try await self.client.execute(
            operation: "DescribeRxNormInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the properties associated with an InferRxNorm job. Use this operation to get the status of an inference job.
    ///
    /// Parameters:
    ///   - jobId: The identifier that Amazon Comprehend Medical generated for the job. The StartRxNormInferenceJob operation returns this identifier in its response.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeRxNormInferenceJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeRxNormInferenceJobResponse {
        let input = DescribeRxNormInferenceJobRequest(
            jobId: jobId
        )
        return try await self.describeRxNormInferenceJob(input, logger: logger)
    }

    ///  Gets the properties associated with an InferSNOMEDCT job. Use this operation to get the status of an inference job.
    @Sendable
    @inlinable
    public func describeSNOMEDCTInferenceJob(_ input: DescribeSNOMEDCTInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeSNOMEDCTInferenceJobResponse {
        try await self.client.execute(
            operation: "DescribeSNOMEDCTInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Gets the properties associated with an InferSNOMEDCT job. Use this operation to get the status of an inference job.
    ///
    /// Parameters:
    ///   - jobId:  The identifier that Amazon Comprehend Medical generated for the job. The StartSNOMEDCTInferenceJob operation returns this identifier in its response.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeSNOMEDCTInferenceJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeSNOMEDCTInferenceJobResponse {
        let input = DescribeSNOMEDCTInferenceJobRequest(
            jobId: jobId
        )
        return try await self.describeSNOMEDCTInferenceJob(input, logger: logger)
    }

    /// The DetectEntities operation is deprecated. You should use the DetectEntitiesV2 operation instead. Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information.
    @available(*, deprecated, message: "This operation is deprecated, use DetectEntitiesV2 instead.")
    @Sendable
    @inlinable
    public func detectEntities(_ input: DetectEntitiesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DetectEntitiesResponse {
        try await self.client.execute(
            operation: "DetectEntities", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// The DetectEntities operation is deprecated. You should use the DetectEntitiesV2 operation instead. Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information.
    ///
    /// Parameters:
    ///   - text:  A UTF-8 text string containing the clinical content being examined for entities.
    ///   - logger: Logger use during operation
    @available(*, deprecated, message: "This operation is deprecated, use DetectEntitiesV2 instead.")
    @inlinable
    public func detectEntities(
        text: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DetectEntitiesResponse {
        let input = DetectEntitiesRequest(
            text: text
        )
        return try await self.detectEntities(input, logger: logger)
    }

    /// Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information. Amazon Comprehend Medical only detects medical entities in English language texts. The DetectEntitiesV2 operation replaces the DetectEntities operation. This new action uses a different model for determining the entities in your medical text and changes the way that some entities are returned in the output. You should use the DetectEntitiesV2 operation in all new applications.  The DetectEntitiesV2 operation returns the Acuity and Direction entities as attributes instead of types.
    @Sendable
    @inlinable
    public func detectEntitiesV2(_ input: DetectEntitiesV2Request, logger: Logger = AWSClient.loggingDisabled) async throws -> DetectEntitiesV2Response {
        try await self.client.execute(
            operation: "DetectEntitiesV2", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information. Amazon Comprehend Medical only detects medical entities in English language texts. The DetectEntitiesV2 operation replaces the DetectEntities operation. This new action uses a different model for determining the entities in your medical text and changes the way that some entities are returned in the output. You should use the DetectEntitiesV2 operation in all new applications.  The DetectEntitiesV2 operation returns the Acuity and Direction entities as attributes instead of types.
    ///
    /// Parameters:
    ///   - text: A UTF-8 string containing the clinical content being examined for entities.
    ///   - logger: Logger use during operation
    @inlinable
    public func detectEntitiesV2(
        text: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DetectEntitiesV2Response {
        let input = DetectEntitiesV2Request(
            text: text
        )
        return try await self.detectEntitiesV2(input, logger: logger)
    }

    /// Inspects the clinical text for protected health information (PHI) entities and returns the entity category, location, and confidence score for each entity. Amazon Comprehend Medical only detects entities in English language texts.
    @Sendable
    @inlinable
    public func detectPHI(_ input: DetectPHIRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DetectPHIResponse {
        try await self.client.execute(
            operation: "DetectPHI", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Inspects the clinical text for protected health information (PHI) entities and returns the entity category, location, and confidence score for each entity. Amazon Comprehend Medical only detects entities in English language texts.
    ///
    /// Parameters:
    ///   - text: A UTF-8 text string containing the clinical content being examined for PHI entities.
    ///   - logger: Logger use during operation
    @inlinable
    public func detectPHI(
        text: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DetectPHIResponse {
        let input = DetectPHIRequest(
            text: text
        )
        return try await self.detectPHI(input, logger: logger)
    }

    /// InferICD10CM detects medical conditions as entities listed in a patient record and links those entities to normalized concept identifiers in the ICD-10-CM knowledge base from the Centers for Disease Control. Amazon Comprehend Medical only detects medical entities in English language texts.
    @Sendable
    @inlinable
    public func inferICD10CM(_ input: InferICD10CMRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> InferICD10CMResponse {
        try await self.client.execute(
            operation: "InferICD10CM", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// InferICD10CM detects medical conditions as entities listed in a patient record and links those entities to normalized concept identifiers in the ICD-10-CM knowledge base from the Centers for Disease Control. Amazon Comprehend Medical only detects medical entities in English language texts.
    ///
    /// Parameters:
    ///   - text: The input text used for analysis.
    ///   - logger: Logger use during operation
    @inlinable
    public func inferICD10CM(
        text: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> InferICD10CMResponse {
        let input = InferICD10CMRequest(
            text: text
        )
        return try await self.inferICD10CM(input, logger: logger)
    }

    /// InferRxNorm detects medications as entities listed in a patient record and links to the normalized concept identifiers in the RxNorm database from the National Library of Medicine. Amazon Comprehend Medical only detects medical entities in English language texts.
    @Sendable
    @inlinable
    public func inferRxNorm(_ input: InferRxNormRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> InferRxNormResponse {
        try await self.client.execute(
            operation: "InferRxNorm", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// InferRxNorm detects medications as entities listed in a patient record and links to the normalized concept identifiers in the RxNorm database from the National Library of Medicine. Amazon Comprehend Medical only detects medical entities in English language texts.
    ///
    /// Parameters:
    ///   - text: The input text used for analysis.
    ///   - logger: Logger use during operation
    @inlinable
    public func inferRxNorm(
        text: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> InferRxNormResponse {
        let input = InferRxNormRequest(
            text: text
        )
        return try await self.inferRxNorm(input, logger: logger)
    }

    ///  InferSNOMEDCT detects possible medical concepts as entities and links them to codes from the Systematized Nomenclature of Medicine, Clinical Terms (SNOMED-CT) ontology
    @Sendable
    @inlinable
    public func inferSNOMEDCT(_ input: InferSNOMEDCTRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> InferSNOMEDCTResponse {
        try await self.client.execute(
            operation: "InferSNOMEDCT", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  InferSNOMEDCT detects possible medical concepts as entities and links them to codes from the Systematized Nomenclature of Medicine, Clinical Terms (SNOMED-CT) ontology
    ///
    /// Parameters:
    ///   - text: The input text to be analyzed using InferSNOMEDCT.
    ///   - logger: Logger use during operation
    @inlinable
    public func inferSNOMEDCT(
        text: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> InferSNOMEDCTResponse {
        let input = InferSNOMEDCTRequest(
            text: text
        )
        return try await self.inferSNOMEDCT(input, logger: logger)
    }

    /// Gets a list of medical entity detection jobs that you have submitted.
    @Sendable
    @inlinable
    public func listEntitiesDetectionV2Jobs(_ input: ListEntitiesDetectionV2JobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListEntitiesDetectionV2JobsResponse {
        try await self.client.execute(
            operation: "ListEntitiesDetectionV2Jobs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a list of medical entity detection jobs that you have submitted.
    ///
    /// Parameters:
    ///   - filter: Filters the jobs that are returned. You can filter jobs based on their names, status, or the date and time that they were submitted. You can only set one filter at a time.
    ///   - maxResults: The maximum number of results to return in each page. The default is 100.
    ///   - nextToken: Identifies the next page of results to return.
    ///   - logger: Logger use during operation
    @inlinable
    public func listEntitiesDetectionV2Jobs(
        filter: ComprehendMedicalAsyncJobFilter? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListEntitiesDetectionV2JobsResponse {
        let input = ListEntitiesDetectionV2JobsRequest(
            filter: filter, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listEntitiesDetectionV2Jobs(input, logger: logger)
    }

    /// Gets a list of InferICD10CM jobs that you have submitted.
    @Sendable
    @inlinable
    public func listICD10CMInferenceJobs(_ input: ListICD10CMInferenceJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListICD10CMInferenceJobsResponse {
        try await self.client.execute(
            operation: "ListICD10CMInferenceJobs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a list of InferICD10CM jobs that you have submitted.
    ///
    /// Parameters:
    ///   - filter: Filters the jobs that are returned. You can filter jobs based on their names, status, or the date and time that they were submitted. You can only set one filter at a time.
    ///   - maxResults: The maximum number of results to return in each page. The default is 100.
    ///   - nextToken: Identifies the next page of results to return.
    ///   - logger: Logger use during operation
    @inlinable
    public func listICD10CMInferenceJobs(
        filter: ComprehendMedicalAsyncJobFilter? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListICD10CMInferenceJobsResponse {
        let input = ListICD10CMInferenceJobsRequest(
            filter: filter, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listICD10CMInferenceJobs(input, logger: logger)
    }

    /// Gets a list of protected health information (PHI) detection jobs you have submitted.
    @Sendable
    @inlinable
    public func listPHIDetectionJobs(_ input: ListPHIDetectionJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPHIDetectionJobsResponse {
        try await self.client.execute(
            operation: "ListPHIDetectionJobs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a list of protected health information (PHI) detection jobs you have submitted.
    ///
    /// Parameters:
    ///   - filter: Filters the jobs that are returned. You can filter jobs based on their names, status, or the date and time that they were submitted. You can only set one filter at a time.
    ///   - maxResults: The maximum number of results to return in each page. The default is 100.
    ///   - nextToken: Identifies the next page of results to return.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPHIDetectionJobs(
        filter: ComprehendMedicalAsyncJobFilter? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPHIDetectionJobsResponse {
        let input = ListPHIDetectionJobsRequest(
            filter: filter, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listPHIDetectionJobs(input, logger: logger)
    }

    /// Gets a list of InferRxNorm jobs that you have submitted.
    @Sendable
    @inlinable
    public func listRxNormInferenceJobs(_ input: ListRxNormInferenceJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRxNormInferenceJobsResponse {
        try await self.client.execute(
            operation: "ListRxNormInferenceJobs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a list of InferRxNorm jobs that you have submitted.
    ///
    /// Parameters:
    ///   - filter: Filters the jobs that are returned. You can filter jobs based on their names, status, or the date and time that they were submitted. You can only set one filter at a time.
    ///   - maxResults: Identifies the next page of results to return.
    ///   - nextToken: Identifies the next page of results to return.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRxNormInferenceJobs(
        filter: ComprehendMedicalAsyncJobFilter? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRxNormInferenceJobsResponse {
        let input = ListRxNormInferenceJobsRequest(
            filter: filter, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listRxNormInferenceJobs(input, logger: logger)
    }

    ///  Gets a list of InferSNOMEDCT jobs a user has submitted.
    @Sendable
    @inlinable
    public func listSNOMEDCTInferenceJobs(_ input: ListSNOMEDCTInferenceJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListSNOMEDCTInferenceJobsResponse {
        try await self.client.execute(
            operation: "ListSNOMEDCTInferenceJobs", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Gets a list of InferSNOMEDCT jobs a user has submitted.
    ///
    /// Parameters:
    ///   - filter: 
    ///   - maxResults:  The maximum number of results to return in each page. The default is 100.
    ///   - nextToken:  Identifies the next page of InferSNOMEDCT results to return.
    ///   - logger: Logger use during operation
    @inlinable
    public func listSNOMEDCTInferenceJobs(
        filter: ComprehendMedicalAsyncJobFilter? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListSNOMEDCTInferenceJobsResponse {
        let input = ListSNOMEDCTInferenceJobsRequest(
            filter: filter, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listSNOMEDCTInferenceJobs(input, logger: logger)
    }

    /// Starts an asynchronous medical entity detection job for a collection of documents. Use the DescribeEntitiesDetectionV2Job operation to track the status of a job.
    @Sendable
    @inlinable
    public func startEntitiesDetectionV2Job(_ input: StartEntitiesDetectionV2JobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartEntitiesDetectionV2JobResponse {
        try await self.client.execute(
            operation: "StartEntitiesDetectionV2Job", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts an asynchronous medical entity detection job for a collection of documents. Use the DescribeEntitiesDetectionV2Job operation to track the status of a job.
    ///
    /// Parameters:
    ///   - clientRequestToken: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend Medical generates one for you.
    ///   - dataAccessRoleArn: The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend Medical read access to your input data. For more information, see Role-Based Permissions Required for Asynchronous Operations.
    ///   - inputDataConfig: The input configuration that specifies the format and location of the input data for the job.
    ///   - jobName: The identifier of the job.
    ///   - kmsKey: An AWS Key Management Service key to encrypt your output files. If you do not specify a key, the files are written in plain text.
    ///   - languageCode: The language of the input documents. All documents must be in the same language. Amazon Comprehend Medical processes files in US English (en).
    ///   - outputDataConfig: The output configuration that specifies where to send the output files.
    ///   - logger: Logger use during operation
    @inlinable
    public func startEntitiesDetectionV2Job(
        clientRequestToken: String? = StartEntitiesDetectionV2JobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        inputDataConfig: InputDataConfig,
        jobName: String? = nil,
        kmsKey: String? = nil,
        languageCode: LanguageCode,
        outputDataConfig: OutputDataConfig,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartEntitiesDetectionV2JobResponse {
        let input = StartEntitiesDetectionV2JobRequest(
            clientRequestToken: clientRequestToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            inputDataConfig: inputDataConfig, 
            jobName: jobName, 
            kmsKey: kmsKey, 
            languageCode: languageCode, 
            outputDataConfig: outputDataConfig
        )
        return try await self.startEntitiesDetectionV2Job(input, logger: logger)
    }

    /// Starts an asynchronous job to detect medical conditions and link them to the ICD-10-CM ontology. Use the DescribeICD10CMInferenceJob operation to track the status of a job.
    @Sendable
    @inlinable
    public func startICD10CMInferenceJob(_ input: StartICD10CMInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartICD10CMInferenceJobResponse {
        try await self.client.execute(
            operation: "StartICD10CMInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts an asynchronous job to detect medical conditions and link them to the ICD-10-CM ontology. Use the DescribeICD10CMInferenceJob operation to track the status of a job.
    ///
    /// Parameters:
    ///   - clientRequestToken: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend Medical generates one.
    ///   - dataAccessRoleArn: The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend Medical read access to your input data. For more information, see  Role-Based Permissions Required for Asynchronous Operations.
    ///   - inputDataConfig: Specifies the format and location of the input data for the job.
    ///   - jobName: The identifier of the job.
    ///   - kmsKey: An AWS Key Management Service key to encrypt your output files. If you do not specify a key, the files are written in plain text.
    ///   - languageCode: The language of the input documents. All documents must be in the same language.
    ///   - outputDataConfig: Specifies where to send the output files.
    ///   - logger: Logger use during operation
    @inlinable
    public func startICD10CMInferenceJob(
        clientRequestToken: String? = StartICD10CMInferenceJobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        inputDataConfig: InputDataConfig,
        jobName: String? = nil,
        kmsKey: String? = nil,
        languageCode: LanguageCode,
        outputDataConfig: OutputDataConfig,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartICD10CMInferenceJobResponse {
        let input = StartICD10CMInferenceJobRequest(
            clientRequestToken: clientRequestToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            inputDataConfig: inputDataConfig, 
            jobName: jobName, 
            kmsKey: kmsKey, 
            languageCode: languageCode, 
            outputDataConfig: outputDataConfig
        )
        return try await self.startICD10CMInferenceJob(input, logger: logger)
    }

    /// Starts an asynchronous job to detect protected health information (PHI). Use the DescribePHIDetectionJob operation to track the status of a job.
    @Sendable
    @inlinable
    public func startPHIDetectionJob(_ input: StartPHIDetectionJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartPHIDetectionJobResponse {
        try await self.client.execute(
            operation: "StartPHIDetectionJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts an asynchronous job to detect protected health information (PHI). Use the DescribePHIDetectionJob operation to track the status of a job.
    ///
    /// Parameters:
    ///   - clientRequestToken: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend Medical generates one.
    ///   - dataAccessRoleArn: The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend Medical read access to your input data. For more information, see  Role-Based Permissions Required for Asynchronous Operations.
    ///   - inputDataConfig: Specifies the format and location of the input data for the job.
    ///   - jobName: The identifier of the job.
    ///   - kmsKey: An AWS Key Management Service key to encrypt your output files. If you do not specify a key, the files are written in plain text.
    ///   - languageCode: The language of the input documents. All documents must be in the same language.
    ///   - outputDataConfig: Specifies where to send the output files.
    ///   - logger: Logger use during operation
    @inlinable
    public func startPHIDetectionJob(
        clientRequestToken: String? = StartPHIDetectionJobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        inputDataConfig: InputDataConfig,
        jobName: String? = nil,
        kmsKey: String? = nil,
        languageCode: LanguageCode,
        outputDataConfig: OutputDataConfig,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartPHIDetectionJobResponse {
        let input = StartPHIDetectionJobRequest(
            clientRequestToken: clientRequestToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            inputDataConfig: inputDataConfig, 
            jobName: jobName, 
            kmsKey: kmsKey, 
            languageCode: languageCode, 
            outputDataConfig: outputDataConfig
        )
        return try await self.startPHIDetectionJob(input, logger: logger)
    }

    /// Starts an asynchronous job to detect medication entities and link them to the RxNorm ontology. Use the DescribeRxNormInferenceJob operation to track the status of a job.
    @Sendable
    @inlinable
    public func startRxNormInferenceJob(_ input: StartRxNormInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartRxNormInferenceJobResponse {
        try await self.client.execute(
            operation: "StartRxNormInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts an asynchronous job to detect medication entities and link them to the RxNorm ontology. Use the DescribeRxNormInferenceJob operation to track the status of a job.
    ///
    /// Parameters:
    ///   - clientRequestToken: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend Medical generates one.
    ///   - dataAccessRoleArn: The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend Medical read access to your input data. For more information, see  Role-Based Permissions Required for Asynchronous Operations.
    ///   - inputDataConfig: Specifies the format and location of the input data for the job.
    ///   - jobName: The identifier of the job.
    ///   - kmsKey: An AWS Key Management Service key to encrypt your output files. If you do not specify a key, the files are written in plain text.
    ///   - languageCode: The language of the input documents. All documents must be in the same language.
    ///   - outputDataConfig: Specifies where to send the output files.
    ///   - logger: Logger use during operation
    @inlinable
    public func startRxNormInferenceJob(
        clientRequestToken: String? = StartRxNormInferenceJobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        inputDataConfig: InputDataConfig,
        jobName: String? = nil,
        kmsKey: String? = nil,
        languageCode: LanguageCode,
        outputDataConfig: OutputDataConfig,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartRxNormInferenceJobResponse {
        let input = StartRxNormInferenceJobRequest(
            clientRequestToken: clientRequestToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            inputDataConfig: inputDataConfig, 
            jobName: jobName, 
            kmsKey: kmsKey, 
            languageCode: languageCode, 
            outputDataConfig: outputDataConfig
        )
        return try await self.startRxNormInferenceJob(input, logger: logger)
    }

    ///  Starts an asynchronous job to detect medical concepts and link them to the SNOMED-CT ontology. Use the DescribeSNOMEDCTInferenceJob operation to track the status of a job.
    @Sendable
    @inlinable
    public func startSNOMEDCTInferenceJob(_ input: StartSNOMEDCTInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartSNOMEDCTInferenceJobResponse {
        try await self.client.execute(
            operation: "StartSNOMEDCTInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Starts an asynchronous job to detect medical concepts and link them to the SNOMED-CT ontology. Use the DescribeSNOMEDCTInferenceJob operation to track the status of a job.
    ///
    /// Parameters:
    ///   - clientRequestToken:  A unique identifier for the request. If you don't set the client request token, Amazon Comprehend Medical generates one.
    ///   - dataAccessRoleArn:  The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend Medical read access to your input data.
    ///   - inputDataConfig: 
    ///   - jobName:  The user generated name the asynchronous InferSNOMEDCT job.
    ///   - kmsKey:  An AWS Key Management Service key used to encrypt your output files. If you do not specify a key, the files are written in plain text.
    ///   - languageCode:  The language of the input documents. All documents must be in the same language.
    ///   - outputDataConfig: 
    ///   - logger: Logger use during operation
    @inlinable
    public func startSNOMEDCTInferenceJob(
        clientRequestToken: String? = StartSNOMEDCTInferenceJobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        inputDataConfig: InputDataConfig,
        jobName: String? = nil,
        kmsKey: String? = nil,
        languageCode: LanguageCode,
        outputDataConfig: OutputDataConfig,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartSNOMEDCTInferenceJobResponse {
        let input = StartSNOMEDCTInferenceJobRequest(
            clientRequestToken: clientRequestToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            inputDataConfig: inputDataConfig, 
            jobName: jobName, 
            kmsKey: kmsKey, 
            languageCode: languageCode, 
            outputDataConfig: outputDataConfig
        )
        return try await self.startSNOMEDCTInferenceJob(input, logger: logger)
    }

    /// Stops a medical entities detection job in progress.
    @Sendable
    @inlinable
    public func stopEntitiesDetectionV2Job(_ input: StopEntitiesDetectionV2JobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopEntitiesDetectionV2JobResponse {
        try await self.client.execute(
            operation: "StopEntitiesDetectionV2Job", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops a medical entities detection job in progress.
    ///
    /// Parameters:
    ///   - jobId: The identifier of the medical entities job to stop.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopEntitiesDetectionV2Job(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopEntitiesDetectionV2JobResponse {
        let input = StopEntitiesDetectionV2JobRequest(
            jobId: jobId
        )
        return try await self.stopEntitiesDetectionV2Job(input, logger: logger)
    }

    /// Stops an InferICD10CM inference job in progress.
    @Sendable
    @inlinable
    public func stopICD10CMInferenceJob(_ input: StopICD10CMInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopICD10CMInferenceJobResponse {
        try await self.client.execute(
            operation: "StopICD10CMInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops an InferICD10CM inference job in progress.
    ///
    /// Parameters:
    ///   - jobId: The identifier of the job.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopICD10CMInferenceJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopICD10CMInferenceJobResponse {
        let input = StopICD10CMInferenceJobRequest(
            jobId: jobId
        )
        return try await self.stopICD10CMInferenceJob(input, logger: logger)
    }

    /// Stops a protected health information (PHI) detection job in progress.
    @Sendable
    @inlinable
    public func stopPHIDetectionJob(_ input: StopPHIDetectionJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopPHIDetectionJobResponse {
        try await self.client.execute(
            operation: "StopPHIDetectionJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops a protected health information (PHI) detection job in progress.
    ///
    /// Parameters:
    ///   - jobId: The identifier of the PHI detection job to stop.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopPHIDetectionJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopPHIDetectionJobResponse {
        let input = StopPHIDetectionJobRequest(
            jobId: jobId
        )
        return try await self.stopPHIDetectionJob(input, logger: logger)
    }

    /// Stops an InferRxNorm inference job in progress.
    @Sendable
    @inlinable
    public func stopRxNormInferenceJob(_ input: StopRxNormInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopRxNormInferenceJobResponse {
        try await self.client.execute(
            operation: "StopRxNormInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops an InferRxNorm inference job in progress.
    ///
    /// Parameters:
    ///   - jobId: The identifier of the job.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopRxNormInferenceJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopRxNormInferenceJobResponse {
        let input = StopRxNormInferenceJobRequest(
            jobId: jobId
        )
        return try await self.stopRxNormInferenceJob(input, logger: logger)
    }

    ///  Stops an InferSNOMEDCT inference job in progress.
    @Sendable
    @inlinable
    public func stopSNOMEDCTInferenceJob(_ input: StopSNOMEDCTInferenceJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopSNOMEDCTInferenceJobResponse {
        try await self.client.execute(
            operation: "StopSNOMEDCTInferenceJob", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Stops an InferSNOMEDCT inference job in progress.
    ///
    /// Parameters:
    ///   - jobId:  The job id of the asynchronous InferSNOMEDCT job to be stopped.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopSNOMEDCTInferenceJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopSNOMEDCTInferenceJobResponse {
        let input = StopSNOMEDCTInferenceJobRequest(
            jobId: jobId
        )
        return try await self.stopSNOMEDCTInferenceJob(input, logger: logger)
    }
}

extension ComprehendMedical {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: ComprehendMedical, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}
